package com.woniuxy.education.utils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 判断题目有没有被收藏过
 */
public class IsCollect {
    public static boolean IsCollect(int titleid,String str){
        if(str.length()==0){
            return false;
        }
        String[] strings = str.split(",");
        List<String> strArr = new ArrayList<>(Arrays.asList(strings));
        for (String item : strArr) {
            if (item.equals(titleid)||Integer.parseInt(item)==titleid) {
                return true;
            }
        }
        return false;
    }
}
